import { inject, Injectable } from '@angular/core';
import { Observable } from 'rxjs';

import { CardRegex } from '@app/core/services/http/card-regex/card-regex.service';
import { ModalWrapService } from '@app/widget/base-modal';
import { NzSafeAny } from 'ng-zorro-antd/core/types';
import { ModalOptions } from 'ng-zorro-antd/modal';

import { ValidationModalComponent } from './validation-modal.component';

@Injectable({
  providedIn: 'root'
})
export class ValidationModalService {
  private readonly modalWrapService = inject(ModalWrapService);
  protected getContentComponent(): NzSafeAny {
    return ValidationModalComponent;
  }

  public show(modalOptions: ModalOptions = {}, modalData?: CardRegex): Observable<NzSafeAny> {
    return this.modalWrapService.show(this.getContentComponent(), modalOptions, modalData);
  }
}
